# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=emacs-helm
pkgver=3.9.7_git20240329
_gitrev=5632e1eb9a11e9df149dee23b2fe469dd7413739
pkgrel=0
_pkgreal=helm
pkgdesc="Emacs incremental completion and selection narrowing framework"
url="https://github.com/emacs-helm/helm"
arch="noarch"
license="GPL-3.0-or-later"
depends="
	cmd:emacs
	emacs-async
	emacs-popup
	"
makedepends="emacs-nox"
source="https://github.com/emacs-helm/helm/archive/$_gitrev/emacs-helm-$_gitrev.tar.gz
	remove-autoload-check.patch
	"
builddir="$srcdir/$_pkgreal-$_gitrev"
options="!check" # no tests provided

build() {
	emacs -batch -q -no-site-file -L . \
		-f batch-byte-compile \
		./*.el
}

package() {
	install -Dvm755 emacs-helm.sh "$pkgdir"/usr/bin/emacs-helm
	install -Dvm644 ./*.el ./*.elc \
		-t "$pkgdir"/usr/share/emacs/site-lisp/$_pkgreal/

	cd "$pkgdir"/usr/share/emacs/site-lisp/$_pkgreal
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-autoloads.el\")"
}

sha512sums="
c6a11ca1dd4774e138be904b35127d6d83e840fcbecc8020a7251f5f6810729de0b566ed8f266ee9db602eb4297206cbc7a6d5a114db49c2b6ccbb4410c72d4a  emacs-helm-5632e1eb9a11e9df149dee23b2fe469dd7413739.tar.gz
88b7e5bd620072e6e87d8f1eb335fa2fb5f1df5c3783b00607b5f5111fb3f937c36076c05c075e2276e368eba9f8e8d11cad8b1de5d05e1bab00ef6f766f7c61  remove-autoload-check.patch
"
